<head>
    <script type="text/javascript" src="../js/univer.full.umd.js" charset="UTF-8"></script>
    <script type="text/javascript" src="../js/zh-CN.js" charset="UTF-8"></script>
    <link rel="stylesheet" href="../css/univer.css" charset="UTF-8">
    <!--        <script src="https://unpkg.com/@univerjs/umd/lib/univer.full.umd.js"></script>-->
    <!--        <script src="https://unpkg.com/@univerjs/umd/lib/locale/zh-CN.js"></script>-->
    <!--        <link rel="stylesheet" href="https://unpkg.com/@univerjs/umd/lib/univer.css">-->
</head>
<body>
<div id="app"></div>

<script>
    var {
        UniverCore,
        UniverDesign,
        UniverEngineRender,
        UniverEngineFormula,
        UniverDocs,
        UniverDocsUi,
        UniverUi,
        UniverSheets,
        UniverSheetsUi,
        UniverSheetsNumfmt,
        UniverSheetsFormula,
        UniverFacade,
    } = window

    var univer = new UniverCore.Univer({
        theme: UniverDesign.defaultTheme,
        locale: UniverCore.LocaleType.ZH_CN,
        locales: {
            [UniverCore.LocaleType.ZH_CN]: UniverUMD['zh-CN'],
        },
    });

    univer.registerPlugin(UniverEngineRender.UniverRenderEnginePlugin);
    univer.registerPlugin(UniverEngineFormula.UniverFormulaEnginePlugin);

    univer.registerPlugin(UniverUi.UniverUIPlugin, {
        container: "app",
    });

    univer.registerPlugin(UniverDocs.UniverDocsPlugin);
    univer.registerPlugin(UniverDocsUi.UniverDocsUIPlugin);

    univer.registerPlugin(UniverSheets.UniverSheetsPlugin);
    univer.registerPlugin(UniverSheetsUi.UniverSheetsUIPlugin);
    univer.registerPlugin(UniverSheetsNumfmt.UniverSheetsNumfmtPlugin);
    univer.registerPlugin(UniverSheetsFormula.UniverSheetsFormulaPlugin);

    univer.createUnit(UniverCore.UniverInstanceType.UNIVER_SHEET, {});

    const univerAPI = UniverFacade.FUniver.newAPI(univer);
    const sheet = univerAPI.getActiveWorkbook().getActiveSheet();

    // A1 设置数字 1
    const range = sheet.getRange(0, 0, 1, 1);
    range.setValue(1);
    const savedData = univerAPI.getActiveWorkbook().save();
    console.log(savedData);
    /* 加载数据
    IWorkbookData = UniverCore.IWorkbookData;
    const data: IWorkbookData = {};
    const workbook = univer.createUnit(UniverCore.UniverInstanceType.UNIVER_SHEET, data);*/
    /**
     * 修改数据
     */

</script>
</body>